Text dictionary tags

Description

Show and define the Text Dictionary tags (<a5:t>...</a5:t>) used in the component.

images/dict.png
A textbox control that has been tagged. The tag has five assigned languages with data for each language.

Text dictionary tags are a very convenient way to add multiple translations to a component. The text dictionary tags function very much like language tags. However, unlike language tags, the data used in text dictionary tags is stored in an SQL table. This table can be easily created in the Project Properties section of Alpha Anywhere. The generated table has three fields: a key field, a language field, and a data field. The rows of generated tables can be filled in here, using the 'Text dictionary tags' property, provided that there are controls in the component that have received text dictionary tags.

images/dict2.png
The 'Create New Text Dictionary Entry' hyperlink makes it easy to add new language definitions to controls

In cases where you wish to assign <a5:t>...</a5:t> tags to many controls in one go, it can be very helpful to use the Internationalization Helper Utilities option, which is accessible through the Additional Options Menu on the UX Controls page. Once a number of tags have been defined you can set the language that you want to display in the component using the 'Active language' property.

In addition to the guides found on this page and linked pages, there are also several videos that explain the use of text dictionary tags. The videos below explain how to create and define text dictionary tags and edit existing tags. There is also a video that explains how to use the Internationalization Genie, i.e. the internationalization helper utilities.

Create a Text Dictionary Table

These examples are also shown on the Active language page. The 'Active language' page also demonstrates how to create a dropdown list to allow users to select the active language.

You can automatically select the active language using the device's culture code. See Supporting Device Culture Codes to learn more.

  1. In the Web Projects Control Panel click on the Project Properties button in the panel toolbar.

    images/ctd.png
  2. Scroll down to and expand the 'Text Dictionary Table Settings' section. Click on the button next to the Connection string property.

    images/ctd2.png
  3. Set the Table Type to SQL

    images/ctd3.png
  4. Click the button next to the 'Connection string' property and form a connection string to the Northwind database.

    images/ctd4.png
  5. Type the name of the Table you wish to create in the 'Table name' property, in this can 'Language Dictionary'. As this is a new table you can simply type the table name into the textbox next to this property.

    images/ctd5.png
  6. Click the 'Create Text Dictionary Table' button at the bottom of the 'Define Text Dictionary Table' dialog. A message should be displayed stating that the table was created. Click OK and OK again.

    images/ctd6.png

Create Controls that use Text Dictionary Tags from the Table

  1. Create a new UX Component. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the TextBox option to add a textbox control to the component. Give the text box control the name and label 'name'.

    images/cc.png
  2. Go back to the 'Data Controls' menu and click on the [TextArea] option to add a text area control to the component. Give this control the name and label of 'input'

    images/cc2.png
  3. Open the 'Other Controls' menu and click on [Button] to add a button control to your component.

    images/cc3.png
  4. Highlight the button control. In the properties list on the right change the 'Button text' property to read 'submit'.

    images/cc4.png

Add the Text Dictionary Tags

  1. In the UX Controls page click the 'Menu' dropdown in the toolbar to open the Additional Options Menu. Select the 'Internationalization Helper Utilities' option.

    images/ihu.png
  2. In the helper dialog click the 'Select Option' button, choose 'Control Labels', and then click 'Add Text Dictionary tags to all control Labels'.

    images/ihu2.png
  3. The control labels you defined should appear with <a5:t></a5:t> tags around them. Click the 'Execute Code' button.

    images/ihu3.png
  4. Click the 'Select Option' button again, choose the 'Button Controls' option, and click add Text Dictionary tags to all control Labels'.

    images/ihu4.png
  5. Click the 'Execute Code' button and close the 'Internationalization Helper Utilities' dialog.

    images/ihu5.png

Add Language Definitions to Each Tag

  1. In the UX Builder on the UX Properties page scroll down to the 'Other' properties section. Click the button next to the 'Text dictionary tags' property.

    images/ald.png
  2. In the 'Text Dictionary Tags Used in this Component' list highlight the 'Name' tag.

    images/ald2.png
  3. Click the 'Create New Text Dictionary Entry' button. We will be creating a new entry for "English". If you have set the Active language to <culture>, you must enter the appropriate culture code here. For example, "en-US" for US English. If you have set the Active language to <Default>, you can define the language as 'English'.

    images/ald3.png
  4. Enter some text into the 'Enter Text' dialog to define the value of the name control for the English language. Type something like the following and click OK.

    Enter your name.
    images/ald4.png
  5. Click the 'Create New Text Dictionary Entry' button a second time. Enter the name of a second language entry that you want to define. Here we will put 'Japanese'.

    images/ald5.png

    If the active language will be determined from the culture code, enter "ja" instead of "Japanese".

  6. Define some text for the second language and click OK. This can be cut and pasted from some other text; for example, from Google Translate.

    images/ald6.png
  7. Click the 'Create New Text Dictionary Entry' button a third time. Add a third language to the 'name' tag, like "French".

    images/ald7.png

    If the active language will be determined from the culture code, enter "fr-FR" instead of "French".

  8. Define the text for the third language.

    images/ald8.png
  9. Highlight the 'Input' tag in the 'Text Dictionary Tags Used in this component' list.

    images/ald9.png
  10. Add the English, Japanese, and French languages to the 'Input' tag, defining new text for each language in the same way as you did for the name tag.

    images/ald10.png
  11. Repeat for the 'submit' tag. Then click OK to close the dialog.

    images/ald11.png
  12. In the 'Other' properties section of the UX Properties page, set the 'Active language' property to one of the languages that you defined in the 'Text dictionary tags' property.

    images/dict4.png
  13. Run the component in Live Preview. You should see the data in each control correlate with the active language that you defined.

    images/dict3.png

See Also